﻿Imports System.IO


Module Module1
    Public AllOK As Boolean
    Public Sub ValidatePaths()
        AllOK = True
        Form1.chkKeytool.Visible = True
        If File.Exists(Form1.lblJAVAPATH.Text + "\keytool.exe") Then
            Form1.chkKeytool.Checked = True
            Form1.chkKeytool.ForeColor = Color.Green
        Else
            Form1.chkKeytool.Checked = False
            Form1.chkKeytool.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkJarsigner.Visible = True
        If File.Exists(Form1.lblJAVAPATH.Text + "\jarsigner.exe") Then
            Form1.chkJarsigner.Checked = True
            Form1.chkJarsigner.ForeColor = Color.Green
        Else
            Form1.chkJarsigner.Checked = False
            Form1.chkJarsigner.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkAPKTool.Visible = True
        If File.Exists(Form1.lblAPKTOOLSPATH.Text + "\apktool.bat") Then
            Form1.chkAPKTool.Checked = True
            Form1.chkAPKTool.ForeColor = Color.Green
        Else
            Form1.chkAPKTool.Checked = False
            Form1.chkAPKTool.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkZipalign.Visible = True
        If File.Exists(Form1.lblANDROIDSDKTOOLSPATH.Text + "\zipalign.exe") Then
            Form1.chkZipalign.Checked = True
            Form1.chkZipalign.ForeColor = Color.Green
        Else
            Form1.chkZipalign.Checked = False
            Form1.chkZipalign.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkZipalign.Visible = True
        If File.Exists(Form1.lblANDROIDSDKTOOLSPATH.Text + "\zipalign.exe") Then
            Form1.chkZipalign.Checked = True
            Form1.chkZipalign.ForeColor = Color.Green
        Else
            Form1.chkZipalign.Checked = False
            Form1.chkZipalign.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkProjectFolder.Visible = True
        If My.Computer.FileSystem.DirectoryExists(Form1.lblPROJECTPATH.Text) Then
            Form1.chkProjectFolder.Checked = True
            Form1.chkProjectFolder.ForeColor = Color.Green
        Else
            Form1.chkProjectFolder.Checked = False
            Form1.chkProjectFolder.ForeColor = Color.Red
            AllOK = False
        End If

        Form1.chkKeystores.Visible = True
        If My.Computer.FileSystem.DirectoryExists(Form1.lblKEYSTOREPATH.Text) Then
            Form1.chkKeystores.Checked = True
            Form1.chkKeystores.ForeColor = Color.Green
        Else
            Form1.chkKeystores.Checked = False
            Form1.chkKeystores.ForeColor = Color.Red
            AllOK = False
        End If
        If AllOK = True Then Form1.Button10.Enabled = True
    End Sub
End Module
